home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / dynaweb.idb / usr / lib / Insight / dweb / sgi5 / bin / start.z / start
Encoding:
Text File  |  1997-07-30  |  2.1 KB  |  100 lines

  1. #!/bin/csh -f
  2. #
  3. # $Id: start 1.7 1997/05/22 13:52:55 des Exp $
  4. #
  5. # Copyright (c) 1991-1997, Inso Corporation.
  6. # All Rights Reserved.
  7. #
  8. #
  9. # Usage: start
  10. #
  11. #   This script starts the dwhttpd daemon.
  12. #
  13. #####################################################################
  14. set machine = `uname -s`
  15. set env_set = 0
  16. switch ("$machine")
  17.    case "HP*":
  18.       set LIB_PATH = SHLIB_PATH
  19.       if ( $?SHLIB_PATH ) then
  20.          set env_set = 1
  21.       endif
  22.       breaksw
  23.  
  24.    case  "SunOS*":
  25.    case  "IRIX*":
  26.       set LIB_PATH = LD_LIBRARY_PATH
  27.       if ( $?LD_LIBRARY_PATH ) then
  28.          set env_set = 1
  29.       endif
  30.       breaksw
  31.  
  32.    case  "AIX*":
  33.       set LIB_PATH = LIBPATH
  34.       if ( $?LIBPATH ) then
  35.          set env_set = 1
  36.       endif
  37.       breaksw
  38.  
  39.    default  :
  40.       set LIB_PATH = LD_LIBRARY_PATH
  41.       if ( $?LD_LIBRARY_PATH ) then
  42.          set env_set = 1
  43.       endif
  44.       breaksw
  45.  
  46. endsw
  47.  
  48.  
  49. if( $env_set == 1 ) then
  50.    setenv $LIB_PATH ../lib:`eval echo \$$LIB_PATH`
  51. else
  52.    setenv $LIB_PATH ../lib
  53. endif
  54.  
  55. if ($#argv < 1) then
  56.    if ($?DWEB_DATA_DIR) then
  57.       set data_dir=$DWEB_DATA_DIR
  58.       set got_data_dir_by=env
  59.    else
  60.       set data_dir=../../data
  61.       set got_data_dir_by=default
  62.    endif
  63. else
  64.    set data_dir=$1
  65.    set got_data_dir_by=arg
  66. endif
  67.  
  68. if (! -e $data_dir) then
  69.    echo "DATA directory '$data_dir' not does not exist\!"
  70.  
  71.    switch ($got_data_dir_by)
  72.  
  73.       case default:
  74.       echo "You can either supply a DATA directory argument to this script"
  75.      echo "or you can set an environment variable called DWEB_DATA_DIR to"
  76.      echo "designate a path to a valid DATA directory."
  77.       breaksw
  78.  
  79.       case arg:
  80.      echo "The DATA directory argument you supplied does not point at a"
  81.      echo "valid DATA directory.  Please check the path and try again."
  82.      echo "Optionally, you can set a variable called DWEB_DATA_DIR to "
  83.      echo "designate a path to a valid DATA directory."
  84.       breaksw
  85.  
  86.       case env:
  87.      echo "The DWEB_DATA_DIR enviroment variable does not point at a valid"
  88.      echo "DATA directory.  Please check the path and try again."
  89.       breaksw
  90.  
  91.    endsw
  92.    exit
  93. else
  94.    if ($data_dir == '../../data') then
  95.       set data_dir=""
  96.    endif
  97. endif
  98.  
  99. ./dwhttpd $data_dir
  100.